<html>
<head><meta charset="utf-8"><title>Real messed up rebase · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Real.20messed.20up.20rebase.html">Real messed up rebase</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="223028370"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Real%20messed%20up%20rebase/near/223028370" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pierwill <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Real.20messed.20up.20rebase.html#223028370">(Jan 17 2021 at 06:53)</a>:</h4>
<p>Hi all! I messed this one up pretty bad and do not know how to fix it <a href="https://github.com/rust-lang/rust/pull/80325">https://github.com/rust-lang/rust/pull/80325</a>.</p>
<p>Might close this and simply take another pass at editing these docs</p>



<a name="223028421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Real%20messed%20up%20rebase/near/223028421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pierwill <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Real.20messed.20up.20rebase.html#223028421">(Jan 17 2021 at 06:54)</a>:</h4>
<p>I knew I shoulda read the dev guide on rebasing! <span aria-label="innocent" class="emoji emoji-1f607" role="img" title="innocent">:innocent:</span> <span aria-label="sad" class="emoji emoji-2639" role="img" title="sad">:sad:</span></p>



<a name="223029747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Real%20messed%20up%20rebase/near/223029747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dániel Buga <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Real.20messed.20up.20rebase.html#223029747">(Jan 17 2021 at 07:33)</a>:</h4>
<p>I'd probably try to edit the first commit: <code>git rebase -i master</code> (I usually rebase onto master even though it might be technically unnecessary, this is my lazy way of learning as little git cli as necessary), then modify the first commit from "pick" to "edit", then making sure not to commit the submodules, and finish the whole thing by a <code>git push --force</code>.</p>



<a name="223030196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Real%20messed%20up%20rebase/near/223030196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dániel Buga <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Real.20messed.20up.20rebase.html#223030196">(Jan 17 2021 at 07:45)</a>:</h4>
<p>I believe the complete process would look something like this:</p>
<ul>
<li><code>git rebase -i master</code></li>
<li>modify the first commit from <code>pick</code> to <code>edit</code></li>
<li><code>git reset --soft HEAD^1</code></li>
<li><code>git restore --staged src/*</code> to remove the changes to submodules</li>
<li><code>git submodule update --recursive</code> gets rid of the modified submodules</li>
<li><code>git commit -m "Whatever the first commit message was"</code></li>
<li><code>git rebase --continue</code></li>
<li><code>git push --force</code></li>
</ul>



<a name="223047276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Real%20messed%20up%20rebase/near/223047276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Real.20messed.20up.20rebase.html#223047276">(Jan 17 2021 at 15:15)</a>:</h4>
<p>it would be easier to start from a new checkout of master and cherry pick the commits you're actually interested in I think</p>



<a name="223047294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Real%20messed%20up%20rebase/near/223047294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Real.20messed.20up.20rebase.html#223047294">(Jan 17 2021 at 15:15)</a>:</h4>
<div class="codehilite"><pre><span></span><code>git checkout master
git checkout -b fix-docs-2
git cherry-pick fix-docs
</code></pre></div>
<p>and then make any changes you want and you can use <code>git commit --amend</code> if you want the previous changes to disappear</p>



<a name="223057462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Real%20messed%20up%20rebase/near/223057462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pierwill <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Real.20messed.20up.20rebase.html#223057462">(Jan 17 2021 at 19:01)</a>:</h4>
<p>Thanks all! I'll give this a shot and see what happens :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>